import type {ChatInfo} from "~/stores/interface";
import { defineStore } from "pinia";
export const chatInfo= defineStore('chatInfo',{
    state: (): ChatInfo => {
        return {
            chatkey:'',
            storeuuid:'',
            free_count:0,
            loginset:0,
            quePage:1,
            usecount:0,
            visitor:''
        }
    },
    actions: {
        removeChatkey() {
            this.chatkey = ''
        },
        dataFill(state: ChatInfo) {

            this.$state = { ...this.$state, ...state }
        },
        getChatKey(){
            return this.chatkey
        },
        setUsecount(){
            return this.usecount++
        },
        setquePage(page:number){
            this.quePage = page
        }
    },
    persist: true,
})
